﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Antu.WebControls;
using Antu.Core.Components;
using Antu.Core.Services;
using System.Web.UI.WebControls;
using EluZSProvider;
using System.Web;
using System.Data;

namespace WebSys.UI.Control.ZhengShou
{
    public class CX_YJJGInfoControl : MPBasicTemplate
    {
        EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
        CustomGridView CustomGridList1;
        Literal Literal1;
        public string strType = string.Empty;
        protected override void OnLoad(EventArgs e)
        {
            InitControl();
            if (!base.Page.IsPostBack)
            {
                BindData();
            }
            CustomGridList1.OnLoadData += new EventHandler(CustomGridList1_OnLoadData);
            
            //base.Page.ClientScript.RegisterStartupScript(this.GetType(), "sd", "<script>alert('" + strType + "');</script>");
        }
        protected void InitControl() {
            CustomGridList1 = (CustomGridView)FindControl("CustomGridList1");
            Literal1 = (Literal)FindControl("Literal1");
        }
        protected void BindData()
        {
            string getType = base.Page.Request["TYPE"];
            if (!string.IsNullOrEmpty(getType))
            {
                strType = base.Page.Server.UrlDecode(getType);
            }
            if (!string.IsNullOrEmpty(strType))
            {
                Literal1.Text = strType;
                CustomGridList1.RowDataBound += new GridViewRowEventHandler(CustomGridList1_RowDataBound);

                string sql = string.Empty;
                if (strType == "安置房源面积小于被征收面积")
                {
                    sql = @"Select p.建筑面积 安置房源面积,z.房屋建筑面积 被征收面积,z.产权人,z.证件号,z.承租人,z.丘权号,z.房屋坐落,p.楼层房间号 安置房源房间号 from zs_proloupan p,zs_zsperson z where p.zspid=z.id And p.建筑面积<z.房屋建筑面积";
                }
                else if (strType == "补偿价款已严重超过此区域房屋均价")
                {
                    sql = @"Select (select (to_number(nvl(replace(TEXTBOX19,'\',''),0))+
(to_number(nvl(replace(TEXTBOX40,'\',''),0))+
to_number(nvl(replace(TEXTBOX48,'\',''),0))+
to_number(nvl(replace(TEXTBOX51,'\',''),0))+
to_number(nvl(replace(TEXTBOX37,'\',''),0)))) 协议款 from zs_hbhxy
Where personid=t.personid And pnid=t.pnid) 补偿价款,
((select sum(to_number(nvl(replace(ZZ评估总价, '\', ''),0))  +to_number(nvl(replace(YY评估总价, '\', ''),0))+to_number(nvl(replace(FYY评估总价, '\', ''),0))) 区域房屋均价 
from zs_zzbcjfenhu Where zspid=t.personid And pid=t.pnid)
*(Select nvl(补偿装修费用预警值,0)/100 From zs_yjcs)) 此区域房屋均价,
(Select 产权人 From zs_zsperson Where Id=t.personid) 产权人,
(Select 证件号 From zs_zsperson Where Id=t.personid) 证件号,
(Select 房屋坐落 From zs_zsperson Where Id=t.personid) 房屋坐落,
(Select 房屋建筑面积 From zs_zsperson Where Id=t.personid) 房屋建筑面积,
(Select 承租人 From zs_zsperson Where Id=t.personid) 承租人,
(Select 项目名称 From zs_project Where Id In (Select pid From zs_prono Where Id=t.pnid)) 项目名称,
(Select 立项号 From zs_project Where Id In (Select pid From zs_prono Where Id=t.pnid)) 立项号
From zs_hbhxy t 
Where (select (to_number(nvl(replace(TEXTBOX19,'\',''),0))+
(to_number(nvl(replace(TEXTBOX40,'\',''),0))+
to_number(nvl(replace(TEXTBOX48,'\',''),0))+
to_number(nvl(replace(TEXTBOX51,'\',''),0))+
to_number(nvl(replace(TEXTBOX37,'\',''),0)))) 协议款 from zs_hbhxy
Where personid=t.personid And pnid=t.pnid)
>
((select sum(to_number(nvl(replace(ZZ评估总价, '\', ''),0))  +to_number(nvl(replace(YY评估总价, '\', ''),0))+to_number(nvl(replace(FYY评估总价, '\', ''),0))) 区域房屋均价 
from zs_zzbcjfenhu Where zspid=t.personid And pid=t.pnid)
*(Select nvl(补偿装修费用预警值,0)/100 From zs_yjcs)) ";
                }
                else if (strType == "补偿装修费用已超过预警值")
                {
                    sql = @"Select 
(select (to_number(nvl(replace(TEXTBOX19,'\',''),0))+
(to_number(nvl(replace(TEXTBOX40,'\',''),0))+
to_number(nvl(replace(TEXTBOX48,'\',''),0))+
to_number(nvl(replace(TEXTBOX51,'\',''),0))+
to_number(nvl(replace(TEXTBOX37,'\',''),0)))) 协议款 from zs_hbhxy
Where personid=t.personid And pnid=t.pnid) 补偿装修费用,
((Select (sum(to_number(nvl(replace(zz产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zz承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(yy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(yy承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(fyy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(fyy承租人补偿款, '\', ''), 0))) +
       sum(to_number(nvl(replace(zs产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zs承租人补偿款, '\', ''), 0)))) 评估款 
from zs_zzbcjfenhu Where zspid=t.personid And pid=t.pnid)
*(Select nvl(补偿装修费用预警值,0)/100 From zs_yjcs)) 预警值,
(Select 产权人 From zs_zsperson Where Id=t.personid) 产权人,
(Select 证件号 From zs_zsperson Where Id=t.personid) 证件号,
(Select 房屋坐落 From zs_zsperson Where Id=t.personid) 房屋坐落,
(Select 房屋建筑面积 From zs_zsperson Where Id=t.personid) 房屋建筑面积,
(Select 承租人 From zs_zsperson Where Id=t.personid) 承租人,
(Select 项目名称 From zs_project Where Id In (Select pid From zs_prono Where Id=t.pnid)) 项目名称,
(Select 立项号 From zs_project Where Id In (Select pid From zs_prono Where Id=t.pnid)) 立项号
From zs_hbhxy t
Where (select (to_number(nvl(replace(TEXTBOX19,'\',''),0))+
(to_number(nvl(replace(TEXTBOX40,'\',''),0))+
to_number(nvl(replace(TEXTBOX48,'\',''),0))+
to_number(nvl(replace(TEXTBOX51,'\',''),0))+
to_number(nvl(replace(TEXTBOX37,'\',''),0)))) 协议款 from zs_hbhxy
Where personid=t.personid And pnid=t.pnid)
>
((Select (sum(to_number(nvl(replace(zz产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zz承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(yy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(yy承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(fyy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(fyy承租人补偿款, '\', ''), 0))) +
       sum(to_number(nvl(replace(zs产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zs承租人补偿款, '\', ''), 0)))) 评估款 
from zs_zzbcjfenhu Where zspid=t.personid And pid=t.pnid)
*(Select nvl(补偿装修费用预警值,0)/100 From zs_yjcs)) ";
                }
                else if (strType == "余额已低于警戒值")
                {
                    sql = @"Select (Select (To_Number(Nvl((Select Sum(To_Number(Nvl(Replace(到账金额,
                                                               '\',
                                                               ''),
                                                       0)))
                                From Zs_New_Money
                               Where Bid = p.Id),
                              0)) - To_Number(Nvl((Select Sum(To_Number(Nvl(Replace(划转金额,
                                                                                    '\',
                                                                                    ''),
                                                                            0)))
                                                     From Zs_Change_Money
                                                    Where Bid = p.Id),
                                                   0)))
          From Dual) 余额,
((select to_number(nvl((select sum(to_number(nvl(replace(t.TEXTBOX19, '\', ''), 0)) +
                   to_number(nvl(replace(t.TEXTBOX40, '\', ''), 0)) +
                   to_number(nvl(replace(t.TEXTBOX48, '\', ''), 0)) +
                   to_number(nvl(replace(t.TEXTBOX51, '\', ''), 0)) +
                   to_number(nvl(replace(t.TEXTBOX37, '\', ''), 0))) hb
          from zs_hbhxy t
         where t.pnid in (select id from zs_prono where pid=p.pnid) ),0)) +
       to_number(nvl((select sum(to_number(nvl(replace(z.TEXTBOX21, '\', ''), 0)) +
                   to_number(nvl(replace(z.TEXTBOX38, '\', ''), 0)) +
                   to_number(nvl(replace(z.TEXTBOX41, '\', ''), 0)) +
                   to_number(nvl(replace(z.TEXTBOX49, '\', ''), 0)) +
                   to_number(nvl(replace(z.TEXTBOX52, '\', ''), 0))) cq
          from zs_cqzhxy z
         where z.fid in
               (select id
                  from zs_proloupan z1
                 where z1.pid in (select id from zs_prono where pid=p.pnid))),0)) 款 from dual)*
                 (Select nvl(余额警戒值,0)/100 From zs_yjcs)) 余额警戒值,
          (Select 项目名称 From zs_project Where Id =p.pnid) 项目名称,
(Select 立项号 From zs_project Where Id =p.pnid) 立项号,
p.开户银行,
(Case When p.开户审核状态=0 Then '未申请'
      When p.开户审核状态=1 Then '已经申请'
      When p.开户审核状态=2 Then '退回'
      When p.开户审核状态=3 Then '审核通过' Else '' End ) 开户审核状态
From Zs_Bcbasicinfo p 
Where ((select to_number(nvl((select sum(to_number(nvl(replace(t.TEXTBOX19, '\', ''), 0)) +
                   to_number(nvl(replace(t.TEXTBOX40, '\', ''), 0)) +
                   to_number(nvl(replace(t.TEXTBOX48, '\', ''), 0)) +
                   to_number(nvl(replace(t.TEXTBOX51, '\', ''), 0)) +
                   to_number(nvl(replace(t.TEXTBOX37, '\', ''), 0))) hb
          from zs_hbhxy t
         where t.pnid in (select id from zs_prono where pid=p.pnid) ),0)) +
       to_number(nvl((select sum(to_number(nvl(replace(z.TEXTBOX21, '\', ''), 0)) +
                   to_number(nvl(replace(z.TEXTBOX38, '\', ''), 0)) +
                   to_number(nvl(replace(z.TEXTBOX41, '\', ''), 0)) +
                   to_number(nvl(replace(z.TEXTBOX49, '\', ''), 0)) +
                   to_number(nvl(replace(z.TEXTBOX52, '\', ''), 0))) cq
          from zs_cqzhxy z
         where z.fid in
               (select id
                  from zs_proloupan z1
                 where z1.pid in (select id from zs_prono where pid=p.pnid))),0)) 款 from dual)*
                 (Select nvl(余额警戒值,0)/100 From zs_yjcs))     
>
(Select (To_Number(Nvl((Select Sum(To_Number(Nvl(Replace(到账金额,
                                                               '\',
                                                               ''),
                                                       0)))
                                From Zs_New_Money
                               Where Bid = p.Id),
                              0)) - To_Number(Nvl((Select Sum(To_Number(Nvl(Replace(划转金额,
                                                                                    '\',
                                                                                    ''),
                                                                            0)))
                                                     From Zs_Change_Money
                                                    Where Bid = p.Id),
                                                   0)))
          From Dual)";
                }
                else if (strType == "账户余额为零")
                {
                    sql = @"Select (Nvl((Select Sum(To_Number(Nvl(Replace(到账金额,'\',''),0))) From Zs_New_Money Where Bid = p.Id),0)) 到账金额,
To_Number(Nvl((Select Sum(To_Number(Nvl(Replace(划转金额,'\',''),0))) From Zs_Change_Money Where Bid = p.Id),0)) 划转金额,
(Select 项目名称 From zs_project Where Id =p.pnid) 项目名称,
(Select 立项号 From zs_project Where Id =p.pnid) 立项号,
p.开户银行,
(Case When p.开户审核状态=0 Then '未申请'
      When p.开户审核状态=1 Then '已经申请'
      When p.开户审核状态=2 Then '退回'
      When p.开户审核状态=3 Then '审核通过' Else '' End ) 开户审核状态
From Zs_Bcbasicinfo p 
 Where (Select (To_Number(Nvl((Select Sum(To_Number(Nvl(Replace(到账金额,'\',''),0))) From Zs_New_Money Where Bid = p.Id),0)) - 
To_Number(Nvl((Select Sum(To_Number(Nvl(Replace(划转金额,'\',''),0)))
From Zs_Change_Money Where Bid = p.Id),0)))From Dual)=0";
                }
                else if (strType == "存在部分协议补偿款未支付")
                {
                    sql = @"Select (select sum(replace(到账金额, '\', '')) from zs_bcbasicinfo Where pnid =t.pnid) 补偿价款,
(select sum(replace(划转金额, '\', '')) from zs_bcbasicinfo Where pnid =t.pnid) 划转金额,
(Select 项目名称 From zs_project Where Id =t.pnid) 项目名称,
(Select 立项号 From zs_project Where Id =t.pnid) 立项号,
t.开户银行,
(Case When t.开户审核状态=0 Then '未申请'
      When t.开户审核状态=1 Then '已经申请'
      When t.开户审核状态=2 Then '退回'
      When t.开户审核状态=3 Then '审核通过' Else '' End ) 开户审核状态
From zs_bcbasicinfo t 
Where (select sum(replace(到账金额, '\', '')) from zs_bcbasicinfo Where pnid =t.pnid) >
(select sum(replace(划转金额, '\', '')) from zs_bcbasicinfo Where pnid =t.pnid)";
                }
                else if (strType == "到账余额已小于所有协议所对应的补偿额度")
                {
                    sql = @"Select (select sum(replace(到账金额, '\', '')) from zs_bcbasicinfo Where pnid =t.pnid) 到账金额,
(select sum(to_number(nvl(replace(ZZ承租人补偿款, '\', ''), 0)) +
to_number(nvl(replace(ZZ产权人补偿款, '\', ''), 0)) +
to_number(nvl(replace(YY承租人补偿款, '\', ''), 0)) +
to_number(nvl(replace(YY产权人补偿款, '\', ''), 0)) +
to_number(nvl(replace(FYY承租人补偿款, '\', ''), 0)) +
to_number(nvl(replace(FYY产权人补偿款, '\', ''), 0)) +
to_number(nvl(replace(ZS承租人补偿款, '\', ''), 0)) +
to_number(nvl(replace(ZS产权人补偿款, '\', ''), 0))) 
from zs_zzbcjfenhu Where pid In (Select Id From zs_prono Where pid =t.pnid)) 需划转额度,
(Select 项目名称 From zs_project Where Id =t.pnid) 项目名称,
(Select 立项号 From zs_project Where Id =t.pnid) 立项号,
t.开户银行,
(Case When t.开户审核状态=0 Then '未申请'
      When t.开户审核状态=1 Then '已经申请'
      When t.开户审核状态=2 Then '退回'
      When t.开户审核状态=3 Then '审核通过' Else '' End ) 开户审核状态
From zs_bcbasicinfo t 
Where (select sum(to_number(nvl(replace(ZZ承租人补偿款, '\', ''), 0)) +
to_number(nvl(replace(ZZ产权人补偿款, '\', ''), 0)) +
to_number(nvl(replace(YY承租人补偿款, '\', ''), 0)) +
to_number(nvl(replace(YY产权人补偿款, '\', ''), 0)) +
to_number(nvl(replace(FYY承租人补偿款, '\', ''), 0)) +
to_number(nvl(replace(FYY产权人补偿款, '\', ''), 0)) +
to_number(nvl(replace(ZS承租人补偿款, '\', ''), 0)) +
to_number(nvl(replace(ZS产权人补偿款, '\', ''), 0))) 需划转额度
from zs_zzbcjfenhu Where pid In (Select Id From zs_prono Where pid =t.pnid)) >
(select sum(replace(到账金额, '\', '')) from zs_bcbasicinfo Where pnid =t.pnid)";
                }
                else if (strType == "补偿总价小于评估总价")
                {
                    sql = @"Select 
((select to_number(nvl(Sum(to_number(nvl(replace(TEXTBOX19,'\',''),0))+
(to_number(nvl(replace(TEXTBOX40,'\',''),0))+
to_number(nvl(replace(TEXTBOX48,'\',''),0))+
to_number(nvl(replace(TEXTBOX51,'\',''),0))+
to_number(nvl(replace(TEXTBOX37,'\',''),0)))),0)) from zs_hbhxy
Where personid=t.id)+
(Select to_number(nvl(Sum(
to_number(nvl(replace(textbox19, '\', '0'), 0)) +
to_number(nvl(replace(textbox38, '\', '0'), 0))+
to_number(nvl(replace(textbox41, '\', '0'), 0)) +
to_number(nvl(replace(textbox49, '\', '0'), 0)) +
to_number(nvl(replace(textbox52, '\', '0'), 0))),0))
From zs_cqzhxy Where fid In (Select Id From zs_proloupan Where zspid=t.id))) 补偿总价,
(Select to_number(nvl(sum(to_number(nvl(replace(zz产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zz承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(yy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(yy承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(fyy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(fyy承租人补偿款, '\', ''), 0))+
       to_number(nvl(replace(zs产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zs承租人补偿款, '\', ''), 0))),0))  
from zs_zzbcjfenhu Where zspid=t.id) 评估总价,
t.产权人,t.证件号,t.承租人,t.房屋建筑面积,t.房屋坐落/*,
(Case When t.pid Is Not Null Then (
(Select 项目名称 From zs_project Where Id=t.pid)
)Else (
Select 项目名称 From zs_project Where Id In (
Select pid From zs_prono Where Id In (Select pid From zs_zzbcjfenhu Where zspid=t.id))
) End ) 项目名称,
(Case When t.pid Is Not Null Then (
(Select 立项号 From zs_project Where Id=t.pid)
)Else (
Select 立项号 From zs_project Where Id In (
Select pid From zs_prono Where Id In (Select pid From zs_zzbcjfenhu Where zspid=t.id))
) End ) 立项号*/
From zs_zsperson t 
Where ((select to_number(nvl(Sum(to_number(nvl(replace(TEXTBOX19,'\',''),0))+
(to_number(nvl(replace(TEXTBOX40,'\',''),0))+
to_number(nvl(replace(TEXTBOX48,'\',''),0))+
to_number(nvl(replace(TEXTBOX51,'\',''),0))+
to_number(nvl(replace(TEXTBOX37,'\',''),0)))),0)) from zs_hbhxy
Where personid=t.id)+
(Select to_number(nvl(Sum(
to_number(nvl(replace(textbox19, '\', '0'), 0)) +
to_number(nvl(replace(textbox38, '\', '0'), 0))+
to_number(nvl(replace(textbox41, '\', '0'), 0)) +
to_number(nvl(replace(textbox49, '\', '0'), 0)) +
to_number(nvl(replace(textbox52, '\', '0'), 0))),0))
From zs_cqzhxy Where fid In (Select Id From zs_proloupan Where zspid=t.id)))<
(Select to_number(nvl(sum(to_number(nvl(replace(zz产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zz承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(yy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(yy承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(fyy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(fyy承租人补偿款, '\', ''), 0))+
       to_number(nvl(replace(zs产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zs承租人补偿款, '\', ''), 0))),0))  
from zs_zzbcjfenhu Where zspid=t.id)";
                }
                else if (strType == "补偿总价超出评估总价")
                {
                    sql = @"Select 
((select to_number(nvl(Sum(to_number(nvl(replace(TEXTBOX19,'\',''),0))+
(to_number(nvl(replace(TEXTBOX40,'\',''),0))+
to_number(nvl(replace(TEXTBOX48,'\',''),0))+
to_number(nvl(replace(TEXTBOX51,'\',''),0))+
to_number(nvl(replace(TEXTBOX37,'\',''),0)))),0)) from zs_hbhxy
Where personid=t.id)+
(Select to_number(nvl(Sum(
to_number(nvl(replace(textbox19, '\', '0'), 0)) +
to_number(nvl(replace(textbox38, '\', '0'), 0))+
to_number(nvl(replace(textbox41, '\', '0'), 0)) +
to_number(nvl(replace(textbox49, '\', '0'), 0)) +
to_number(nvl(replace(textbox52, '\', '0'), 0))),0))
From zs_cqzhxy Where fid In (Select Id From zs_proloupan Where zspid=t.id))) 补偿总价,
(Select to_number(nvl(sum(to_number(nvl(replace(zz产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zz承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(yy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(yy承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(fyy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(fyy承租人补偿款, '\', ''), 0))+
       to_number(nvl(replace(zs产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zs承租人补偿款, '\', ''), 0))),0))  
from zs_zzbcjfenhu Where zspid=t.id) 评估总价,
t.产权人,t.证件号,t.承租人,t.房屋建筑面积,t.房屋坐落/*,
(Case When t.pid Is Not Null Then (
(Select 项目名称 From zs_project Where Id=t.pid)
)Else (
Select 项目名称 From zs_project Where Id In (
Select pid From zs_prono Where Id In (Select pid From zs_zzbcjfenhu Where zspid=t.id))
) End ) 项目名称,
(Case When t.pid Is Not Null Then (
(Select 立项号 From zs_project Where Id=t.pid)
)Else (
Select 立项号 From zs_project Where Id In (
Select pid From zs_prono Where Id In (Select pid From zs_zzbcjfenhu Where zspid=t.id))
) End ) 立项号*/
From zs_zsperson t 
Where ((select to_number(nvl(Sum(to_number(nvl(replace(TEXTBOX19,'\',''),0))+
(to_number(nvl(replace(TEXTBOX40,'\',''),0))+
to_number(nvl(replace(TEXTBOX48,'\',''),0))+
to_number(nvl(replace(TEXTBOX51,'\',''),0))+
to_number(nvl(replace(TEXTBOX37,'\',''),0)))),0)) from zs_hbhxy
Where personid=t.id)+
(Select to_number(nvl(Sum(
to_number(nvl(replace(textbox19, '\', '0'), 0)) +
to_number(nvl(replace(textbox38, '\', '0'), 0))+
to_number(nvl(replace(textbox41, '\', '0'), 0)) +
to_number(nvl(replace(textbox49, '\', '0'), 0)) +
to_number(nvl(replace(textbox52, '\', '0'), 0))),0))
From zs_cqzhxy Where fid In (Select Id From zs_proloupan Where zspid=t.id)))>
(Select to_number(nvl(sum(to_number(nvl(replace(zz产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zz承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(yy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(yy承租人补偿款, '\', ''), 0)) +
       to_number(nvl(replace(fyy产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(fyy承租人补偿款, '\', ''), 0))+
       to_number(nvl(replace(zs产权人补偿款, '\', ''), 0)) + to_number(nvl(replace(zs承租人补偿款, '\', ''), 0))),0))  
from zs_zzbcjfenhu Where zspid=t.id)";
                }
                if (!string.IsNullOrEmpty(sql))
                {
                    DataTable dt = _EluZSDataProvider.GetTable(sql);
                    CustomGridList1.DataSource = dt;
                    CustomGridList1.RecordCount = dt.Rows.Count;
                    CustomGridList1.DataBind();
                }
            }
            else {
                Literal1.Text = "系统预警监管";
            }
            
        }
        protected void CustomGridList1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //DataRowView rowview = (DataRowView)e.Row.DataItem;
                //string strId = rowview["ID"].ToString();
                //Literal 评估机构选定 = (Literal)e.Row.FindControl("评估机构选定");
                //评估机构选定.Text = _EluZSDataProvider.GetString(@"");
            }
        }
        protected void CustomGridList1_OnLoadData(object sender, EventArgs e)
        {
            BindData();
        }
    }
}
